package testrank.affinity;

/**
 * @author Hagai Cibulski
 *
 */
public class WordInfo implements Comparable<WordInfo> {

	private String word;
	
	private int count;

	public WordInfo(String word) {
		this(word, 1);
	}
	
	public WordInfo(String word, int count) {
		this.word = word;
		this.count = count;
	}

	public String getWord() {
		return this.word;
	}

	public int getCount() {
		return this.count;
	}
	
	public void add(int c) {
		count += c;
	}

	@Override
	public int compareTo(WordInfo info) {
		return this.count - info.count;
	}

	@Override
	public String toString() {
		return "WordInfo [word=" + this.word + ", count=" + this.count + "]";
	}
}
